﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S_Gridding.Api.Application.Commands.Gridding;

namespace S_Gridding.Api.Controllers
{
    /// <summary>
    /// 基础网格管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GriddingController : ControllerBase
    {
        private readonly IMediator _mediator;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="mediator"></param>
        public GriddingController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> GriddingCreate(GriddingCreateCommands command)
        {
            return await _mediator.Send(command);
        }
    }
}
